let webpack = require('./node_modules/webpack/lib/webpack')

let proxyObj ={}

proxyObj['/api']={
    //websocket
    ws:false,
    //后端目标地址
    target:'http://localhost:9000/v1',
    //发送的请求头会设置target
    changeOrigin:true,
    //不重写请求地址
    pathRewrite:{
        '^/api':''
    }
}

module.exports = {

    devServer:{
       host:'localhost',
       port:8082,
       proxy:proxyObj
    },

    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                $: "jquery",
                jQuery: "jquery",
                "windows.jQuery": "jquery"
            })
        ]
    },
    css: {
        loaderOptions: {
            css: {},
            postcss: {
                plugins: [
                    require('postcss-px2rem')({
                        remUnit: 60.5
                    })
                ]
            }
        }
    }

}